import request from '@/utils/request'
import store from '@/store'

// 查询费目
export function webCate() {
  let user = store.state.user?.user;
  return request({
    url: '/system/dict/data/type/web_cate',
    method: 'get',
  }).then((res)=>{
    let data = res.data.filter((v)=>{
      if(v.remark){
        let arr = v.remark.split(',')
        return arr.indexOf(user.deptId+'')>-1
      }else{
        return false;
      }
    })
    return data;
  })
}

// 上传
export function upload({file}){
  let form = new FormData();
  form.append("file",file);
  return request({
    url:"/common/upload",
    method:"post",
    data:form
  })
}
